home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Bitmap / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.2 KB  |  127 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef BMPFRAME_H
  13. #define BMPFRAME_H
  14.  
  15. #ifndef DEFINES_K
  16. #include "Defines.k"
  17. #endif
  18.  
  19. // ----- Framework Includes -----
  20.  
  21. #ifndef FWFRAME_H
  22. #include "FWFrame.h"
  23. #endif
  24.  
  25. #ifndef FWFDRGDRP_H
  26. #include "FWDrgDrp.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Forward Declarations
  31. //========================================================================================
  32.  
  33. class FW_CGrowBox;
  34. class CBitmapPart;
  35. class CBitmapSelection;
  36. class CBitmapContent;
  37.  
  38. //========================================================================================
  39. //    class CBitmapFrame
  40. //========================================================================================
  41.  
  42. class CBitmapFrame : public FW_CFrame, public FW_MDraggableFrame, public FW_MDroppableFrame
  43. {
  44. //----------------------------------------------------------------------------------------
  45. //    Initialization/Destruction
  46. //
  47. public:
  48.     FW_DECLARE_AUTO(CBitmapFrame)
  49.     
  50.     CBitmapFrame(Environment* ev, 
  51.                 ODFrame* odFrame, 
  52.                 FW_CPresentation* presentation, 
  53.                 CBitmapPart* bitmapPart,
  54.                 CBitmapContent* bitmapContent);
  55.     virtual ~ CBitmapFrame();
  56.     
  57. //----------------------------------------------------------------------------------------
  58. //    Inherited API
  59. //
  60. public:
  61.     virtual FW_Handled                DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  62.     virtual FW_Handled                DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  63.  
  64.     virtual void                    FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner);
  65. #if FW_SUPPORTS_CYBERDOG
  66.     virtual FW_Handled                HandleWindowEvent (Environment* ev, const FW_CMacWindowEvent& windowEvent);
  67. #endif
  68.     virtual void                     FrameShapeChanged(Environment* ev);
  69.     
  70.     virtual ODShape*                AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
  71.     virtual ODShape*                AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
  72.  
  73.     virtual void                    AdjustZoomedWindowSize(Environment *ev, FW_CPoint& proposedSize);
  74.  
  75.     virtual void                     Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  76.     virtual void                    BuildThumbnail(Environment* ev, FW_CGraphicContext& gc, FW_CRect& usedRect);
  77.             
  78.     virtual FW_Handled                DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  79.     
  80.     virtual FW_Handled                DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
  81.     
  82.     virtual void                    CreateSubViews(Environment* ev);
  83.  
  84.     // ----- Commands -----
  85.     virtual FW_CClipboardCommand*    NewClipboardCommand(Environment* ev, ODCommandID commandID);
  86.  
  87.     virtual FW_CDropCommand*         NewDropCommand(Environment *ev, 
  88.                                         FW_CFrame* frame,
  89.                                         ODDragItemIterator* dropInfo, 
  90.                                         ODFacet* facet, 
  91.                                         const FW_CPoint& dropPoint);
  92.  
  93.     virtual FW_CDragCommand*         NewDragCommand(Environment *ev, 
  94.                                         FW_CFrame* theFrame,
  95.                                         const FW_CMouseEvent& theMouseEvent);
  96.  
  97.     // ----- External/Internalize -----
  98.     virtual void                    ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  99.     virtual void                    InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  100.  
  101. //----------------------------------------------------------------------------------------
  102. //    New API
  103. //
  104. public:
  105.     FW_CPoint                        GetZoomRatio(Environment* ev) const;
  106.     void                            AdjustFrameSize(Environment* ev);
  107.  
  108.     void                            CalcUsedRect(Environment* ev, FW_CRect& newUsedRect) const;
  109.     
  110.     ODCommandID                        GetChosenSize() const
  111.                                         {return fChosenSize;}
  112.                                         
  113.     void                            SetContainingPartColor(Environment* ev, const FW_CPoint& mousePoint) const;
  114.                                 
  115. //----------------------------------------------------------------------------------------
  116. //    Data Members
  117. //
  118. private:
  119.     CBitmapContent*         fBitmapContent;        // Pointer to my content
  120.     ODCommandID                fChosenSize;        // Chosen Size (50%, 100%, 200%, or fit to frame)
  121.     FW_CRect                fFrameRect;            // The lastest frame shape rect
  122.     CBitmapSelection*        fSelection;
  123.     FW_CIdler*                fIdler;
  124. };
  125.  
  126. #endif
  127.